/********************************************************************************
 * Copyright (c) 2017, 2018 Bosch Connected Devices and Solutions GmbH.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * Contributors:
 *    Bosch Connected Devices and Solutions GmbH - initial contribution
 *
 * SPDX-License-Identifier: EPL-2.0
 ********************************************************************************/

package org.eclipse.mita.program.generator;

import org.eclipse.mita.program.generator.IPlatformStartupGenerator.NullImpl;
import com.google.inject.ImplementedBy;

@ImplementedBy(NullImpl.class)
public interface IPlatformStartupGenerator {

	/**
	 * Generates the code which runs first when the application launches. This code
	 * has to execute MitaInitialize, enqueue MitaGoLive and start the event loop
	 * afterwards.
	 */
	public CodeFragment generateMain(CompilationContext context);

	public class NullImpl implements IPlatformStartupGenerator {

		@Override
		public CodeFragment generateMain(CompilationContext context) {
			return CodeFragment.EMPTY;
		}
	}
}